import request from '@/utils/request'

// 仓库列表
export function warehouse(query) {
  return request({
    url: '/erp_api/zhouyz/warehouse/list',
    method: 'get',
    params: query
  })
}

// 仓库详情
export function warehouseDetail(query) {
  return request({
    url: `/erp_api/zhouyz/warehouse/${query.id}`,
    method: 'get'
  })
}

// 仓库流水
export function warehouseRecord(query) {
  return request({
    url: '/erp_api/zhouyz/warehouse/record/list',
    method: 'get',
    params: query
  })
}

// 流水详情
export function warehouseRecordDetail(query) {
  return request({
    url: `/erp_api/zhouyz/warehouse/record/${query.id}`,
    method: 'get'
  })
}

// 仓库调拨
export function warehouseAllocation(query) {
  return request({
    url: '/erp_api/zhouyz/warehouseAllocation/list',
    method: 'get',
    params: query
  })
}

// 仓库调拨详情
export function warehouseAllocationDetail(query) {
  return request({
    url: `/erp_api/zhouyz/warehouseAllocation/${query.id}`,
    method: 'get'
  })
}

// 仓库调拨商品详情
export function warehouseAllocationProduct(query) {
  return request({
    url: `/erp_api/zhouyz/warehouseAllocation/product-list/${query.id}`,
    method: 'get'
  })
}

// 入库单
export function warehouseRecordStockIn(query) {
  return request({
    url: '/erp_api/zhouyz/warehouse/record/stockIn',
    method: 'get',
    params: query
  })
}

// 出库单
export function warehouseRecordStockOut(query) {
  return request({
    url: '/erp_api/zhouyz/warehouse/record/stockOut',
    method: 'get',
    params: query
  })
}

// 报损报溢
export function lossAndOverflow(query) {
  return request({
    url: '/erp_api/zhouyz/warehouseStorageTake/lossAndOverflow/list',
    method: 'get',
    params: query
  })
}

// 报损报溢详情
export function lossAndOverflowDetail(query) {
  return request({
    url: `/erp_api/zhouyz/warehouseStorageTake/${query.id}`,
    method: 'get'
  })
}

// 报损报溢商品详情
export function lossAndOverflowProductDetail(id, query) {
  return request({
    url: `/erp_api/zhouyz/warehouseStorageTakeDetail/list/${id}`,
    method: 'get',
		params: query
  })
}

// 仓库盘存
export function warehouseStorageTake(query) {
  return request({
    url: '/erp_api/zhouyz/warehouseStorageTake/list',
    method: 'get',
    params: query
  })
}

// 仓库盘存详情
export function warehouseStorageTakeDetail(query) {
  return request({
    url: `/erp_api/zhouyz/warehouseStorageTake/${query.id}`,
    method: 'get'
  })
}

// 组合拆分日志
export function warehouseMix(query) {
  return request({
    url: '/erp_api/zhouyz/warehouseMix/list',
    method: 'get',
    params: query
  })
}

// 组合拆分详情
export function warehouseMixDetail(query) {
  return request({
    url: `/erp_api/zhouyz/warehouseMix/${query.id}`,
    method: 'get'
  })
}

// 调拨明细
export function warehouseAllocationRecord(query) {
  return request({
    url: '/erp_api/zhouyz/warehouseAllocationDetail/list',
    method: 'get',
    params: query
  })
}